package com.jzcn.service.impl;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.jzcn.common.base.BaseServiceImpl;
import com.jzcn.common.dto.log.LogListDTO;
import com.jzcn.common.dto.log.SearchLogDTO;
import com.jzcn.common.utils.BeanUtils;
import com.jzcn.common.utils.JzPage;
import com.jzcn.mapper.SysLogMapper;
import com.jzcn.domain.SysLog;
import com.jzcn.service.SysLogService;
import org.springframework.stereotype.Service;

@Service
public class SysLogServiceImpl extends BaseServiceImpl<SysLogMapper, SysLog> implements SysLogService {

    @Override
    public JzPage<LogListDTO> listPage(SearchLogDTO searchLogDTO) {
        IPage<SysLog> iPage = new Page<>(searchLogDTO.getPageNum(), searchLogDTO.getPageSize());
        return BeanUtils.convertPage(new JzPage<>(baseMapper.findPage(iPage,searchLogDTO)), LogListDTO.class);

    }
}
